package com.mayikt;

import com.mayikt.observable.MessageObservable;
import com.mayikt.observable.observer.EmailObServer;
import com.mayikt.observable.observer.SmsObServer;
import com.mayikt.observable.observer.WechatObServer;

import java.util.Observable;

public class TestJDKObserver {

    public static void main(String[] args) {
        //1. 创建具体的主题
        Observable observable = new MessageObservable();
        //2. 注册消息
        observable.addObserver(new SmsObServer());
        observable.addObserver(new EmailObServer());
        observable.addObserver(new WechatObServer());
        //3. 群发消息
        observable.notifyObservers("每特教育平均月薪破三万");
    }
}
